home *** CD-ROM | disk | FTP | other *** search
- This routine adds some help in tracking users.
-
- Add the following to your /etc/profile:
-
- ---BEGIN---
- # track login
- USER=`whoami`
- LOGNAME=`logname`
- TTY=`tty`
- export USER LOGNAME TTY
- echo "LOGIN .$LOGNAME.$TTY.`date`" >> /usr/adm/logins
- trap 1 2 3 # signals are restored
- #
- # set the trap for logout
- #
- trap "/sbin/checkout $LOGNAME $TTY" 0
- ---END---
-
- You can see all it does is to build a new logfile called logins, writes
- the username, tty and date of login.
-
- Then when they exit it calls a script called `checkout` and writes the same
- information with updated date/time.
-
- Emmett Sauer
-
-
-